<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="container">

    <router-link to="/">Go to home</router-link>
    <router-link to="/about">Go to about</router-link>
    <router-view>

    </router-view>
</div>

<script src="https://unpkg.com/vue@next"></script>
<script src="https://unpkg.com/vue-router@4"></script>
<script type="text/javascript">

    const Home = {template: '<div>Home</div>'}
    const About = {template: '<div>About</div>'}

    const demoApp = {
        data(){
            return {

            }
        },
        mounted(){

        },
        methods:{

        }

    }

    const router = VueRouter.createRouter({
        history: VueRouter.createWebHashHistory(),
        routes:[
            {path: '/', component: Home},
            {path: '/about', component: About}
        ]
    })

    Vue.createApp(demoApp)
        .use(router)
        .mount('#container')


    // 学习路线图
    // app.use(router) -> router(history, routes) -> routes(path, component) -> component
</script>

</body>
</html>
